#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：11.获取cookie信息.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-11-20 11:08
'''
import requests
url = 'https://www.baidu.com'
headers = {
    "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36",
    "Cookie": "name=123"
}

response = requests.get(url, headers=headers)

print(response.cookies)

# 不区分大小写
print(response.request.headers.get("cookie"))